import gitlab

import manage


class GL:
    def __init__(self):
        self.url = "https://gitlab.cn"
        self.token = "glpat-"
        self.per_page = 100

    def gl(self):
        gl = gitlab.Gitlab(url=self.url, oauth_token=self.token, per_page=self.per_page)
        return gl

# g = GL()
# gl = g.gl()
#
#
# projects = gl.projects.list()
#
# projects_list = []
# for project in projects:
#     projects_list.append({"key": project.id, "label": project.name})
#
# print(projects_list)

# project = gl.projects.get(1)
# f = project.files.raw(file_path='pipelines/kustomization.yaml', ref='dev')
# print(f.decode().splitlines())

# with open('manage.py', 'r') as file:
#     data = file.readlines()
#
# print(type(data),data)





